const Imglist = require('../../db').Imglist

module.exports = {
    async find(ctx,next){
        let id = ctx.params.cateid
        console.log(id)
        try{
            let conds = id==0?{}:{ "cateid":Number(id) }
            console.log(conds)
            let imgInfo = await Imglist.find(conds,null)
            console.log(imgInfo)
            ctx.body = {
                code: 200,
                msg: "获取信息成功",
                list : imgInfo
            }
        } catch(e){
            ctx.body = {
                code: 500,
                msg: "获取信息失败，服务器异常，请稍后再试"
            }
        }
    }
}